package com.rj2002.ctrl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.rj2002.dao.GoodsMapper;
import com.rj2002.pojo.Goods;

@Controller
@RequestMapping("/sale")
public class SalePageCtrl {
	
	@Autowired
	private GoodsMapper goodsMapper;
	
	@RequestMapping("/getAddGoodsJsp")
	public String getAddGoodsJsp() {
		return "saler/getAddGoodsJsp";
	}
	
	@RequestMapping("/getGoodsList")
	public String getGoodsList() {
		return "saler/getGoodsList";
	}
	
	@RequestMapping("/getGoodsedit")
	public String getGoodsedit(int id,Model model) {
		Goods goods = goodsMapper.selectByPrimaryKey(id);
		model.addAttribute("good", goods);
		return "saler/GoodsEdit";
	}
	
	@RequestMapping("/getAllOrder")
	public String getAllOrder(Model model) {
		return "saler/Order";
	}
}
